<!DOCTYPE HTML>
<html>
<head>
    <include file="Common:header_include"/>
    <title>编辑用户</title>
</head>
<body>
<div class="pd-20">
    <form action="{:U('edit')}" method="post" class="form form-horizontal" id="form">
        <input type="text" name="id" hidden value="{$data.id}">
        <div class="row cl">
            <label class="form-label col-3"><span class="c-red"></span>剂量规格：</label>
            <div class="formControls col-8">
                <input type="text" class="input-text" name="value" value="{$data['value']}">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-3"><span class="c-red">*</span>剂量名称：</label>
            <div class="formControls col-8">
                <span class="select-box">
                <select class="select Validform_error" size="1" name="dosenameID" datatype="*" nullmsg="请选择" onchange="selectTopMenu()">
                    <option value="" selected="" disabled="disabled">请选择</option>
                    <volist name=":getList(dimdailyiteminfo,'','id asc')" id="v">
                        <option value="{$v['id']}" <if condition="$data['dosename']['id'] eq $v['id']">selected</if>>{$v['name']}</option>
                    </volist>
                </select>
                </span>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-3"><span class="c-red"></span>剂量单位：</label>
            <div class="formControls col-8">
                <span class="select-box">
                <select class="select Validform_error" size="1" name="contentID" onchange="selectTopMenu()">
                    <option value="" selected="" >请选择</option>
                    <volist name=":getList(dimdailyiteminfo,'','id asc')" id="v">
                        <option value="{$v['id']}" <if condition="$data['content']['id'] eq $v['id']">selected</if>>{$v['name']}</option>
                    </volist>
                </select>
                </span>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-3"><span class="c-red"></span>剂量说明：</label>
            <div class="formControls col-8">
                <textarea rows="6" cols="27" class="textarea" name="description"  autofocus="autofocus" style="resize: none" placeholder="请输入">{$data['description']}</textarea>
            </div>
        </div>

        <div class="row cl">
            <div class="col-9 col-offset-3">
                <input class="btn btn-primary radius" type="submit" value="提交">
            </div>
        </div>
    </form>
</div>
</div>
<include file="Common:footer_include"/>
<script>
    $(function(){
        selectUserGroup($('input[name="user_group_id"]'));
    });
    /**
     * 切换表单必填项
     * @param obj
     */
    function selectUserGroup(obj) {
        var value = obj.val();
        if (value == 2) {
            $('.patient').hide();
            $('.doctor').show();
        } else if (value == 3) {
            $('.patient').show();
            $('.doctor').hide();
        } else {
            $('.patient').hide();
            $('.doctor').hide();
        }
    }

    $('.skin-minimal input').iCheck({
        checkboxClass: 'icheckbox-blue',
        radioClass: 'iradio-blue',
        increaseArea: '20%'
    });

</script>
</body>
</html>